# Root directory of libdai installation
DAI=/home/alfredo/Desktop/libDAI-0.3.1

# Include flags
INC=-I$(DAI)/include

# Library path flags
LIBS=-lgmpxx -lgmp
# Location of libDAI library
LIB=$(DAI)/lib

# Compiler
CC=g++

# Compiler flags
CCFLAGS=-Wno-deprecated -Wall -W -Wextra -fPIC -O3 -static $(INC)
CCFLAGS2=-c -Wno-deprecated -Wall -W -Wextra -fPIC -O3 -static $(INC)

all : bpwrapper bpshared

bpwrapper : bpwrapper.cpp $(LIB)/libdai.a
	$(CC) $(CCFLAGS2) $(LIBS) $(LIB)/libdai.a $< -o bpwrapper.o

bpshared :
	$(CC) -fPIC -shared -W1,-soname,bpwrapper.so -o bpwrapper.so bpwrapper.o $< $(LIB)/libdai.a $(LIBS)

# CLEAN
########

.PHONY : clean
clean :
	-rm bpwrapper.o bpwrapper.so
